package cn.chrisx.drad.audiencenetwork;

import cn.chrisx.drad.core.DrAdPlatform;
import cn.chrisx.drad.core.DrAdType;
import cn.chrisx.drad.wrap.Ad;

/**
 * @author Jzfox <jz_boy@163.com>
 * @version 1.0
 * @date 2018/9/26 13:28
 * @description
 * @copyright ©2018 www.jzfox.net All rights reserved.
 */
public class AudienceNetworkPlatform implements DrAdPlatform {

    public static final String NAME = "AudienceNetwork";

    @Override
    public String name() {
        return NAME;
    }

    @Override
    public Ad executor(DrAdType adType) {

        switch (adType) {
            case BANNER:
                return new BannerImpl();

            case INTERSTITIAL:
                return new InterstitialImpl();

            case REWARD_VIDEO:
                return new RewardVideoImpl();
        }

        return null;
    }

    public static AudienceNetworkPlatform instance() {
        return Holder.PLATFORM;
    }

    private AudienceNetworkPlatform() {
    }

    private static class Holder {
        static final AudienceNetworkPlatform PLATFORM = new AudienceNetworkPlatform();
    }
}
